using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SwapMove : MonoBehaviour
{
    // Start is called before the first frame update

    public float radian;

    public float moveAmplitude = 1f;

    private Vector3 oldPos;


    void Start()
    {
        oldPos = transform.position;
    }

    // Update is called once per frame
    void Update()
    {
        radian += Time.deltaTime*5f;
        float newY = Mathf.Cos(radian) * moveAmplitude;
        transform.position = oldPos + Vector3.forward * newY;
    }
}
